//
//  SettingViewController.m
//  LimitFree
//
//  Created by qianfeng on 15/8/26.
//  Copyright (c) 2015年 Hailong.wang. All rights reserved.
//

#import "SettingViewController.h"
#import "SettingButton.h"
@interface SettingViewController ()

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"设置";
    // Do any additional setup after loading the view.
}
-(void)createView{
    NSArray* title=@[@"我的设置",@"我的关注",@"我的账户",@"我的收藏",@"我的下载",@"我的评论",@"我的帮助",@"蚕豆应用"];
    NSArray* images=@[@"account_setting.png",@"account_favorite.png",@"account_user.png",@"account_collect.png",@"account_download.png",@"account_comment.png",@"account_help.png",@"account_candou.png"];
    CGFloat width=(ScreenWidth-67*3-40*2)/2;
    CGFloat  height=150;
    for (int i=0; i<8; i++) {
        CGRect frame=CGRectMake(width+i%3*107,height+i/3*105, 67, 85);
        
        SettingButton* button=[SettingButton createButtonWithTitle:[title objectAtIndex:i] frame:frame image:[images objectAtIndex:i] clicked:nil target:self selector:@selector(clickedButton:)];
       // SettingButton* button=[SettingButton createButtonWithTitle:[title objectAtIndex:i] frame:frame image:[images objectAtIndex:i] clicked:nil target:SettingButton selector:@selector()];
        button.tag=100+i;
        [self.view addSubview:button];
    }
}
-(void)clickedButton:(UIButton*)button{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
